import request from '@/utils/request'; // axios 封装，可根据你项目调整

/**
 * 分页查询音色
 * @param {Object} params 查询参数
 */
export function pageVoices(params) {
  return request({
    url: '/admin/voices/page',
    method: 'PUT',
    data: params,
  });
}

/**
 * 新增音色
 * @param {Object} data 新增音色参数
 */
export function addVoice(data) {
  return request({
    url: '/admin/voices/add',
    method: 'POST',
    data: data,
  });
}

/**
 * 修改音色
 * @param {Object} data 修改音色参数
 */
export function updateVoice(data) {
  return request({
    url: '/admin/voices/update',
    method: 'PUT',
    data: data,
  });
}

/**
 * 获取音色详情
 * @param {Number} id 音色ID
 */
export function getVoiceInfo(id) {
  return request({
    url: `/admin/voices/userInfo/${id}`,
    method: 'GET',
  });
}

/**
 * 删除音色
 * @param {Number} id 音色ID
 */
export function deleteVoice(id) {
  return request({
    url: `/admin/voices/remove/${id}`,
    method: 'DELETE',
  });
}

//获取智能体id
export function listAIAgent(params) {
  return request({
    url: '/ai/agent/page',
    method: 'put',
    data: params
  })
}

//cosyvoice模型-创建音色
export function createTimbre(id) {
  return request({
    url: `/admin/voices/createvoice/${id}`,
    method: 'POST',
  })
}
//cosyvoice模型-更新音色
export function updateTimbre(params) {
  return request({
    url: '/admin/voices/updatevoice',
    method: 'POST',
    data: params
  })
}